{#**
 * 2007-2020 PrestaShop SA and Contributors
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2020 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}

<div class="customer-carts-card card">
  <h3 class="card-header">
    <i class="material-icons">shopping_cart</i>
    {{ 'Carts'|trans({}, 'Admin.Global') }}
    <span class="badge badge-primary rounded">{{ customerInformation.cartsInformation|length }}</span>
  </h3>
  <div class="card-body">
    {% if customerInformation.cartsInformation is not empty %}
      <table class="table">
        <thead>
          <tr>
            <th>{{ 'ID'|trans({}, 'Admin.Global') }}</th>
            <th>{{ 'Date'|trans({}, 'Admin.Global') }}</th>
            <th>{{ 'Carrier'|trans({}, 'Admin.Global') }}</th>
            <th>{{ 'Total'|trans({}, 'Admin.Global') }}</th>
            <th class="text-right">{{ 'Actions'|trans({}, 'Admin.Global') }}</th>
          </tr>
        </thead>
        <tbody>
        {% for cart in customerInformation.cartsInformation %}
          {% set cartViewUrl = getAdminLink('AdminCarts', true, {'id_cart': cart.cartId, 'viewcart': 1}) %}

          <tr class="customer-cart">
            <td class="customer-cart-id js-linkable-item cursor-pointer" data-linkable-href="{{ cartViewUrl }}">{{ cart.cartId }}</td>
            <td class="customer-cart-date js-linkable-item cursor-pointer" data-linkable-href="{{ cartViewUrl }}">{{ cart.cartCreationDate }}</td>
            <td class="customer-cart-carrier js-linkable-item cursor-pointer" data-linkable-href="{{ cartViewUrl }}">{{ cart.carrierName }}</td>
            <td class="customer-cart-total js-linkable-item cursor-pointer" data-linkable-href="{{ cartViewUrl }}">{{ cart.cartTotal }}</td>
            <td class="customer-cart-actions text-right">
              <div class="btn-group-action">
                <div class="btn-group">
                  <a href="{{ cartViewUrl }}"
                     class="btn tooltip-link dropdown-item"
                     data-toggle="pstooltip"
                     data-placement="top"
                     data-original-title="{{ 'View'|trans({}, 'Admin.Actions') }}"
                  >
                    <i class="material-icons">zoom_in</i>
                  </a>
                </div>
              </div>
            </td>
          </tr>
        {% endfor %}
        </tbody>
      </table>
    {% else %}
      <p class="text-muted text-center mb-0">
        {{ 'No cart is available'|trans({}, 'Admin.Orderscustomers.Notification') }}
      </p>
    {% endif %}
  </div>
</div>
